package com.example.design.mediator;

/**
 * 具体的用户实现类
 */
public class ConcreteUser extends User {
    public ConcreteUser(ChatMediator chatMediator, String name) {
        super(chatMediator, name);
    }

    public void send(String message) {
        System.out.println(this.name + " sends: " + message);
        chatMediator.sendMessage(message, this);
    }

    public void receive(String message) {
        System.out.println(this.name + " receives: " + message);
    }
}
